<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

<style type="text/css">
	*{margin:0; padding:0;}
	ul{list-style-type:none; zoom:1;}
	ul li{float:center; margin:10px; _display:inline; border:0px solid #CCC;}
	ul li a img{width:48px; height:48px; border:0;display:block;margin:0px auto; vertical-align: middle;text-align:center;}
	ul li a.wenzi{line-height:20px; color:#666; display:block; text-align:center;}
	ul li a:hover{color:#F00;}
	ul li a:link{text-decoration: none;}
	.tabsMenu .split{line-height:1px;color:black;display:block;}
	</style>
 <%@include file="./header_inc.jsp" %>
</head>
<script type="text/javascript">
/* //动态生成操作菜单
$(document).ready(function() {
	$.ajax({
		url:'http://localhost:8080/shoeHouse/menu/index',
		type:'post',
		async:false,
		dataType:'json',
		success:function(data){
			if(data.success==0)
			{
			    var pid=0;
			    var content="";
			    var title="";
			    var imgCls="";
				$.each(data.rows,function(i,item){
				    var content="";
				    if(item.children != null)
				    {
				        $.each(item.children,function(i,subItem){
                            content = content + "<li><a href=\"javascript:addTab(\'"+subItem.name+"\',\'"+subItem.url+"\')\"><img src=\"${ctx}/images/icon/"+subItem.img+"\" width=\"32\" /></a><a class=\"wenzi\" href=\"javascript:addTab(\'"+subItem.name+"\',\'"+subItem.url+"\')\">"+subItem.name+"</a></li>";
				        });
				    }
				    $('#nav_menu').accordion('add', {
                        title: "&nbsp;&nbsp;"+item.name,
                        content: '<div style="padding:0px;overflow:hidden"><ul id="ulSubMenu'+item.id+'">'+content+'</ul></div>',
                        selected: false,
                        iconCls: item.img
                    }); 
				});
			}
			else
			{
				showErrMsg(data);
				window.parent.location.href="${ctx}/manage"
			}
		}
	});
}); */
function logout(flag)
{
    var msg;
    if(flag)
    {
        msg = "你是否要退出系统？";
    }
    else
    {
        msg = "你是否要重新登录系统？";
    }
    $.messager.confirm("退出",msg,function(yesOrNo){
    	
        if(yesOrNo)
        {
        	window.parent.location.href="/shoeHouse/userInfo/loginPage"
          /*   $.ajax("${ctx}/manage/logout",{
                error:function(){
                    $.messager.alert("提示","资源访问错误！");
                },
                success:function(json){
					window.parent.location.href="${ctx}/manage"
                }
            }); */
        }
    });
}
function refreshTab(obj,url)
{
     var refresh_tab = obj;
     if (refresh_tab && refresh_tab.find('iframe').length > 0)
        {
           var _refresh_ifram = refresh_tab.find('iframe')[0];
           _refresh_ifram.contentWindow.location.href = url;
        } 
}

function addTab(title,url){
   	if ($('#centerTabs').tabs('exists', title))
   	{
       	var currtab = $('#centerTabs').tabs('getSelected');
       	var tab = $("#centerTabs").tabs("getTab", title);
       	if (currtab == tab) {
           	var url=$(currtab.panel('options').content).attr('src');
           	refreshTab(tab, url);
       	}
       	else {
           	var tab = $("#centerTabs").tabs("select", title);
           	var currtab = $('#centerTabs').tabs('getSelected');
           	var url = $(currtab.panel('options').content).attr('src');
           	refreshTab(tab, url);
       	}
   	}
   	else {
	     var content = '<iframe scrolling="auto" frameborder="0" src="'+url+'" style="width:100%;height:100%;"></iframe>';
       	$('#centerTabs').tabs('add',
           {
               title: title,
               content: content,
               closable: true
           });
   	}
	}
function show(){
	
	var date = new Date(); //日期对象
	var now = "";
	now = date.getFullYear()+"/"; //读英文就行了
	now = now + (date.getMonth()+1)+"/"; //取月的时候取的是当前月-1如果想取当前月+1就可以了
	now = now + date.getDate()+" &nbsp;&nbsp;";
	now = now + date.getHours()+":";
	now = now + date.getMinutes()+":";
	now = now + date.getSeconds()+"&nbsp";
	document.getElementById("nowDiv").innerHTML = now; //div的html是now这个字符串
	setTimeout("show()",1000); //设置过1000毫秒就是1秒，调用show方法
	}

</script>
<body class="easyui-layout" onload="show()">
  	<!-- 上部   start background:url('/shoeHouse/images/mini.png')-->
	<div data-options="region:'north',border:false" style="height:100px;  no-repeat;padding:5px">
 <div  style="margin-left: 150"><img src="/shoeHouse/images/shoelogo.png" width="400" height="100" /></div> 
		<div style="position: absolute; right: 0px; bottom: 0px; ">
			<a href="javascript:void(0);" class="easyui-menubutton" menu="#layout_north_kzmbMenu" iconCls="icon-more">更换主题</a><a href="javascript:void(0);" class="easyui-menubutton" menu="#layout_north_zxMenu" iconCls="icon-back">注销</a>
			<div id="nowDiv" align="center" ></div>
		</div>
		<div  style="width: 100px; display: none;">
			<!--  <div onclick="userInfo();">个人信息</div>
			<div class="menu-sep"></div>
			<span>更换主题</span>-->
			<div>
				
				<div id="layout_north_kzmbMenu" style="width: 100px;">
					<div onclick="javascript:changeTheme('default')">default</div>  
            		<div onclick="javascript:changeTheme('gray')">gray</div>  
           			<div onclick="javascript:changeTheme('material')">material</div>  
         			<div onclick="javascript:changeTheme('metro')">metro</div>  
         			<div onclick="javascript:changeTheme('black')">black</div>  
         			<div onclick="javascript:changeTheme('bootstrap')">bootstrap</div>
				</div>
			</div>
			 
		</div>
		<div id="layout_north_zxMenu" style="width: 100px; display: none;">
		<!-- 
			<div onclick="loginAndRegDialog.dialog('open');">锁定窗口</div>
			<div class="menu-sep"></div> -->
			
			<div onclick="logout();">重新登录</div>
			<div onclick="logout(true);">退出系统</div>
			
		</div>
	</div>
	<!-- 上部   end -->
	<!-- 导航  start -->
	<div data-options="region:'west',split:false,title:'&nbsp;&nbsp;功能菜单',iconCls:'icon-tip'" style="width:160px;padding:0px;overflow:hidden;">
		<div id="nav_menu" class="easyui-accordion" fit="true" border="false" style="">
		
		<div title="信息管理" data-options="iconCls:'icon-search'" style="padding:10px;">
		<div style="padding:0px;overflow:hidden">
		<ul id="ulSubMenu" >
		<li><a href="javascript:addTab('用户信息管理','http://localhost:8080/shoeHouse/userInfo/index')">
用户信息管理</a></li>
		<li>
		<!-- <ul id="ulSubMenu" >
		<li><a href="javascript:addTab('用户信息管理','lll')">用户信息管理</a></li>
             </ul></li> -->
   
      
      <li><a href="javascript:addTab('商品信息管理','http://localhost:8080/shoeHouse/commodifyInfo/index')">商品信息管理</a></li>
      <li><a href="javascript:addTab('权限管理','http://localhost:8080/shoeHouse/role/index')">权限管理</a></li>
      <li><a href="javascript:addTab('订单管理','http://localhost:8080/shoeHouse/order/index')">订单管理</a></li>
       <li><a href="javascript:addTab('订单评价管理','http://localhost:8080/shoeHouse/OrderEvalute/index')">订单评价管理</a></li>
        <li><a href="javascript:addTab('部门信息管理','http://localhost:8080/shoeHouse/DepartmentInfo/index')">部门信息管理</a></li>
         </ul>
      
      </div>
		
		
		</div>
		<div title="TreeMenu" data-options="iconCls:'icon-search'" style="padding:10px;">
			<ul class="easyui-tree">
				<li>
					<span>Foods</span>
					<ul>
						<li>
							<span>Fruits</span>
							<ul>
								<li>apple</li>
								<li>orange</li>
							</ul>
						</li>
						<li>
							<span>Vegetables</span>
							<ul>
								<li>tomato</li>
								<li>carrot</li>
								<li>cabbage</li>
								<li>potato</li>
								<li>lettuce</li>
							</ul>
						</li>
					</ul>
				</li>
			</ul>
		</div>
		</div>
	</div>
	<!-- 导航   end -->
	<!-- 中间   start -->	
	<div data-options="region:'center',title:'当前用户【${userInfo.name }】'"  > 
		<div id="centerTabs" class="easyui-tabs" fit="true">  
		 	<div title="首页" style="">
		 	<iframe scrolling="auto" frameborder="0" src="http://localhost:8080/shoeHouse/userInfo/index" style="width:100%;height:100%;"></iframe>    
    		</div>  
		</div>
	</div>		
	<div id="tabsMenu" class="easyui-menu" style="width:120px;">
	    <div name="refresh">刷新</div>   
	    <div name="close">关闭</div>  
	    <div name="Other">关闭其他</div>  
	    <div name="All">关闭所有</div>
	  </div>  
	<!-- 中间   end -->	
	<!-- 底部   start -->
	<div data-options="region:'south',border:false" style="height:25px;padding:1px;">
		<div  align="center">版权所有shoeHouse工作室</div>
	</div>
	<!-- 底部   end -->
</div>
</body>

</html>